<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>后台--文章管理</title>
    <link rel="stylesheet" type="text/css" href="<?php echo isset($skin)?$skin:"";?>images/style.css" />
    <base target="_self"/>

    <script src='<?php echo isset($skin)?$skin:"";?>js/jquery.min.js'></script>
    <script type="text/javascript" src="<?php echo isset($skin)?$skin:"";?>js/jquery.form.min.js"></script>
    <script type="text/javascript" src="<?php echo isset($skin)?$skin:"";?>js/dist/dialog-min.js"></script>
    <script src="<?php echo isset($skin)?$skin:"";?>js/admin.js"></script>
    <script type="text/javascript">
        <!--
        $(document).ready(function () {
            $('.new_table tbody tr:even').addClass('h'); //奇偶变色，添加样式
        });
        //-->
    </script>
    <script type="text/javascript" charset="UTF-8" src="<?php echo isset($skin)?$skin:"";?>/js/validate.js"></script>
    <script type="text/javascript" charset="UTF-8" src="<?php echo isset($skin)?$skin:"";?>js/artTemplate.js"></script>
    <script type="text/javascript" charset="UTF-8" src="<?php echo isset($skin)?$skin:"";?>js/artTemplate-plugin.js"></script>
    <script type="text/javascript" charset="UTF-8" src="<?php echo isset($skin)?$skin:"";?>js/form.js"></script>
    <script type="text/javascript" charset="UTF-8" src="<?php echo isset($skin)?$skin:"";?>js/artDialog.js"></script>
<script type="text/javascript" charset="UTF-8" src="<?php echo isset($skin)?$skin:"";?>js/iframeTools.js"></script>
<link rel="stylesheet" href="<?php echo isset($skin)?$skin:"";?>js/artdialog.css" type="text/css">
</head>
<body>
<div class="hh6"></div>
<style>
    input{color:#f37b1d !important;font-weight:bold;}
</style>

<script language="javascript" type="text/javascript" src="<?php echo isset($skin)?$skin:"";?>js/My97DatePicker/WdatePicker.js"></script>

<form method="Post" action="?c=<?php echo isset($classname)?$classname:"";?>" name="k_form">
    <table class="new_table" width="99%" border="0" align="center" cellpadding="0" cellspacing="0">
        <thead><tr class="n_bt"><td colspan="5" align="center">工作小助手管理系统</td></tr>
        <tr><th height="28" colspan="2" class="thbt">【<?php echo isset($title)?$title:"";?>】<?php if($new_mod_time){?><span class="red">更新时间:<?php echo isset($new_mod_time)?$new_mod_time:"";?>  更新人:<?php echo isset($new_mod_name)?$new_mod_name:"";?></span><?php }?></th></tr>
        </thead>
        <tbody>
        <tr>
            <td width="13%" height="30" align="right">三级单位：</td>
            <td width="87%">
                <select name="post[company_id]" class="input400 select">
                    <?php if(is_array($list_company))  foreach($list_company as $k=>$v) { ?>
                    <option value="<?php echo isset($v->id)?$v->id:"";?>" <?php if($v->id==$oj->company_id){?>selected<?php }?>><?php echo isset($v->name)?$v->name:"";?></option>
                    <?php }?>
                </select> <span class="red">*</span></td>
        </tr>
        <tr>
            <td width="13%" height="30" align="right">OBJ_ID：</td>
            <td width="87%">
                <input name="post[obj_id]" type="text" placeholder="<?php echo isset($oj->obj_id)?$oj->obj_id:"";?>" value="<?php echo isset($new_mod[obj_id])?$new_mod[obj_id]:"";?>" class="input400" /><span class="red">*</span></td>
        </tr>
        <tr>
            <td width="13%" height="30" align="right">设备类型：</td>
            <td width="87%">

                    <?php if(is_array($list_type))  foreach($list_type as $k=>$v) { ?><?php if($v->id==$oj->type_id){?>
                <input type="text" readonly placeholder="<?php echo isset($v->name)?$v->name:"";?>" class="input400">
                <?php }?>
                    <?php }?>
            </td>
        </tr>
        <tr>
            <td height="30" align="right">设备名称：</td>
            <td><input name="post[name]" type="text" placeholder="<?php echo isset($oj->name)?$oj->name:"";?>" value="<?php echo isset($new_mod[name])?$new_mod[name]:"";?>" class="input400" /></td>
        </tr>
        <tr>
            <td width="13%" height="30" align="right">品牌：</td>
            <td width="87%">
                <select name="post[brand_id]" class="input400 select" <?php if ($new_mod[brand_id] && $new_mod[brand_id]!=$oj->brand_id ){?> style="color:#ff0000"<?php }?>>
                    <?php if(is_array($list_brand))  foreach($list_brand as $k=>$v) { ?>
                    <option value="<?php echo isset($v->id)?$v->id:"";?>"  <?php if ($new_mod[brand_id]){ if($new_mod[brand_id]!=$oj->brand_id && $new_mod[brand_id]==$v->id){?> selected <?php }}else{?>  <?php if($v->id==$oj->brand_id){?>selected<?php }?><?php }?>><?php echo isset($v->name)?$v->name:"";?></option>
                    <?php }?>
                </select> <span class="red">*</span></td>
        </tr>
        <tr>
            <td width="13%" height="30" align="right">设备状态：</td>
            <td width="87%">
                <select name="post[status_id]" class="input400 select" <?php if ($new_mod[status_id] && $new_mod[status_id]!=$oj->status_id ){?> style="color:#ff0000"<?php }?>>
                    <?php if(is_array($list_status))  foreach($list_status as $k=>$v) { ?>
                    <option value="<?php echo isset($v->id)?$v->id:"";?>" <?php if ($new_mod[status_id] ){ if($new_mod[status_id]!=$oj->brand_id && $new_mod[status_id]==$v->id){?> selected <?php }}else{?> <?php if($k==$oj->status_id){?>selected<?php }?><?php }?>><?php echo isset($v->name)?$v->name:"";?></option>
                    <?php }?>
                </select> <span class="red">*</span></td>
        </tr>
        <tr>
            <td width="13%" height="30" align="right">产权归属：</td>
            <td width="87%">
                <select name="post[cq_id]" class="input400 select" <?php if ($new_mod[cq_id] && $new_mod[cq_id]!=$oj->cq_id ){?> style="color:#ff0000"<?php }?>>
                    <?php if(is_array($list_cq))  foreach($list_cq as $k=>$v) { ?>
                    <option value="<?php echo isset($v->id)?$v->id:"";?>" <?php if ($new_mod[cq_id] ){ if( $new_mod[cq_id]!=$oj->brand_id && $new_mod[cq_id]==$v->id){?> selected <?php }}else{?> <?php if($v->id==$oj->cq_id){?>selected<?php }?><?php }?>><?php echo isset($v->name)?$v->name:"";?></option>
                    <?php }?>
                </select> <span class="red">*</span></td>
        </tr>
        <tr>
            <td height="30" align="right"><p>型号：</p></td>
            <td><input name="post[model]" type="text" placeholder="<?php echo isset($oj->model)?$oj->model:"";?>" value="<?php echo isset($new_mod[model])?$new_mod[model]:"";?>" class="input400" />
            </td>
        </tr>
        <tr>
            <td height="30" align="right"><p>出厂编号：</p></td>
            <td><input name="post[product_no]" type="text" placeholder="<?php echo isset($oj->product_no)?$oj->product_no:"";?>" value="<?php echo isset($new_mod->product_no)?$new_mod->product_no:"";?>" class="input400" /></td>
        </tr>
        <tr>
            <td height="30" align="right"><p>出厂日期：</p></td>
            <td><input name="post[product_date]" onClick="WdatePicker()" type="text" placeholder="<?php echo date('Y-m-d',$oj->product_date);?>" value="<?php if($new_mod->product_date){?><?php echo date('Y-m-d',$new_mod->product_date);?><?php }?>" class="input400" /></td>
        </tr>
        <tr>
            <td height="30" align="right"><p>存放地点：</p></td>
            <td>
                <select size="1" name="post[location]" class="input400 select" <?php if ($new_mod['location'] && $new_mod['location']!=$oj->location ){?> style="color:#ff0000"<?php }?>>
                    <?php if(is_array($list_loc))  foreach($list_loc as $k=>$v) { ?>
                    <option value="<?php echo isset($v->id)?$v->id:"";?>" <?php if ($new_mod['location'] ){ if( $new_mod['location']!=$oj->location && $new_mod['location']==$v->id){?> selected <?php }}else{?> <?php if($v->id==$oj->location){?>selected<?php }?><?php }?>><?php echo isset($v->name)?$v->name:"";?></option>
                    <?php }?>
                </select>
            </td>
        </tr>
        <tr>
            <td height="30" align="right"><p>领用部门：</p></td>
            <td><select size="1" name="n[use_department]" class="input400 select" <?php if ($new_mod['use_department'] && $new_mod['use_department']!=$oj->use_department ){?> style="color:#ff0000"<?php }?>>
                    <?php if(is_array($list_department))  foreach($list_department as $k=>$v) { ?>
                    <option value="<?php echo isset($v->id)?$v->id:"";?>" <?php if ($new_mod['use_department']){ if( $new_mod['use_department']!=$oj->brand_id && $new_mod['use_department']==$v->id){?> selected <?php }}else{?>  <?php if($v->id==$oj->use_department){?>selected<?php }?><?php }?>><?php echo isset($v->name)?$v->name:"";?></option>
                    <?php }?>
                </select></td>
        </tr>
        <tr>
            <td height="30" align="right"><p>领用人：</p></td>
            <td><input name="post[use_user_name]" type="text" placeholder="<?php echo isset($oj->use_user_name)?$oj->use_user_name:"";?>" value="<?php echo isset($new_mod->use_user_name)?$new_mod->use_user_name:"";?>" class="input400" /></td>
        </tr>
        <tr>
            <td height="30" align="right"><p>领用日期：</p></td>
            <td><input name="post[use_date]" type="text" onClick="WdatePicker()" placeholder="<?php echo date('Y-m-d',$oj->use_date);?>" value="<?php if($new_mod->use_date){?><?php echo date('Y-m-d',$new_mod->use_date);?><?php }?>" class="input400" /></td>
        </tr>
        <tr>
            <td height="30" align="right"><p>负责人：</p></td>
            <td><input name="post[person_id]" type="text" value="<?php echo isset($new_mod->person)?$new_mod->person:"";?>" placeholder="<?php echo isset($oj->person)?$oj->person:"";?>" class="input400" /></td>
        </tr>
        <tr id="ip">
            <td height="30" align="right"><p>IP：</p></td>
            <td><input name="post[ip]" type="text" value="<?php echo isset($new_mod->ip)?$new_mod->ip:"";?>" placeholder="<?php echo isset($oj->ip)?$oj->ip:"";?>" class="input400" /></td>
        </tr>
        <!--资产性质 start-->

        <tr>
        <td height="30" align="right"><p>资产性质：</p></td><td>
                <select size="1" name="post[zichanxingzhi]" class="input400 select" <?php if ($new_mod['zichanxingzhi'] && $new_mod['zichanxingzhi']!=$oj->zichanxingzhi ){?> style="color:#ff0000"<?php }?>>
                    <?php if(is_array($list_xz))  foreach($list_xz as $k=>$v) { ?>
                    <option value="<?php echo isset($v->id)?$v->id:"";?>" <?php if ($new_mod['zichanxingzhi'] ){ if( $new_mod['zichanxingzhi']!=$oj->brand_id && $new_mod['zichanxingzhi']==$v->id){?> selected <?php }}else{?>  <?php if($v->id==$oj->zichanxingzhi){?>selected<?php }?><?php }?>><?php echo isset($v->name)?$v->name:"";?></option>
                    <?php }?>
                </select>
            </td>
            </tr>
        <!--备案编号 start-->
        <tr>
        <td height="30" align="right"><p>备案编号：</p></td><td>
                <input type="text" name="post[record_no]" class="input400" placeholder="<?php echo isset($oj->record_no)?$oj->record_no:"";?>" value="<?php echo isset($new_mod[record_no])?$new_mod[record_no]:"";?>">
            </td>
        </td>
        </tr>

<tbody id="new">
        <?php if(is_array($field))  foreach($field as $k=>$v) { ?>
        <?php if($k==0)continue;?>
        <!--<?php echo isset($v->Comment)?$v->Comment:"";?> start-->
        <tr>
            <td height="30" align="right"><p><?php echo isset($v->Comment)?$v->Comment:"";?></p></td>
            <td>
                <?php if( $v->Field=='os'){?>
                    <select size="1" name="addon[os]" class="input400 select" <?php if ($new_addon['os'] && $new_addon['os']!=$addon['os'] ){?> style="color:#ff0000"<?php }?>>
                        <?php if(is_array($list_os))  foreach($list_os as $k=>$sv) { ?>
                        <option value="<?php echo isset($sv->id)?$sv->id:"";?>" <?php if ($new_addon['os']){ if($new_addon['os']!=$addon['os'] && $new_addon['os']==$sv->id){?> selected <?php }}else{?>  <?php if($sv->id==$addon['os']){?>selected<?php }?><?php }?>><?php echo isset($sv->name)?$sv->name:"";?></option>
                        <?php }?>
                    </select>
                <?php }elseif($v->Field=='net'){?>
                    <select size="1" name="addon[net]" class="input400 select" <?php if ($new_addon['net'] && $new_addon['net']!=$addon['net'] ){?> style="color:#ff0000"<?php }?>>
                        <?php if(is_array($list_net))  foreach($list_net as $k=>$sv) { ?>
                        <option value="<?php echo isset($sv->id)?$sv->id:"";?>" <?php if ($new_addon['net']){ if($new_addon['net']!=$addon['net'] && $new_addon['net']==$sv->id){?> selected <?php }}else{?>  <?php if($sv->id==$addon['net']){?>selected<?php }?><?php }?>><?php echo isset($sv->name)?$sv->name:"";?></option>
                        <?php }?>
                    </select>
                <?php }else{?>

                <input type="text" name="addon[<?php echo isset($v->Field)?$v->Field:"";?>]" class="<?php if($v->Field=='mac'){?>toup <?php }?> input400" placeholder="<?php
                if($tid){}else{
                    if($addon[$v->Field]){ echo $addon[$v->Field];}else{ echo $v->Comment;}
                }?>" value="<?php echo $new_addon[$v->Field]?>" <?php if($v->Field=='mac'){?>maxlength="12" <?php }?>>

                <?php }?>
            </td>
        </tr>
        <?php }?>

        </tbody>
        <tr>
            <td height="30" align="right">备注：</td>
            <td class="pb5"><textarea name="contents" placeholder="<?php echo isset($oj->con)?$oj->con:"";?>" class="input400 textareah" cols="95" rows="20" ><?php echo isset($new_mod->con)?$new_mod->con:"";?></textarea></td>
        </tr>
        <tr>
            <td height="35" colspan="2" align="center" >
                <input name="sub_update" type="submit" class="button" value="确认更新"/>
                <!--<input name="into_wz" id="submit" class="button" type="submit" value="<?php echo isset($submit)?$submit:"";?>" />-->

                <!--&nbsp;<input name="post[" type="reset" class="button" value="重置" />-->
                <input name="id" type="hidden" value="<?php echo isset($oj->id)?$oj->id:"";?>" />
                <input type="hidden" name="a" value="<?php echo isset($form_action)?$form_action:"";?>" />

            </td>
        </tr>
</tbody>
        </table>
</form>
<script type="text/javascript">
   /* $(function(){
       $("#type_id").change(function(){
           var tid=$(this).val();
           var html= $.get('?c=device&a=ajax_fields&id='+tid,function(data){
               $("#new").html(data);
           })
       });
    })*/
</script>
<script type="text/javascript">
    <!--
    $(document).ready(function () {
        $('.new_table tbody tr:even').addClass('h'); //奇偶变色，添加样式
    });

    //-->
    function alert_del(url) {
        if (confirm("您确定要删除吗？"))
            window.location = url;
        return false;
    }
</script>
</body>
</html>